import request from '@/utils/http'; // 导入http中创建的axios实例
import qs from "qs"
//GTE 传参需要用 params
//POST 传参需要用 data
const adminAct = {
	//后台登录
	adminLogin(params){
		return request({
			url: '/actLogin',
			method: 'post',
			data:params
		})
	},
	//退出当前登录的账号
	adminLogOut(){
		return request({
			url:'/act/logout',
			method:'get'
		})
	},
	//创建账户
	createAdminAccount(params){
		let post_param = qs.stringify(params,{indices: false })
		return request({
			url:'/act/add?' + post_param,
			method:'post'
		})
	},
	//申请代理
	applyAdminAccount(params){
		return request({
			url:'/agent/user/add',
			method:'post',
			data:params
		})
	},
	//获取当前代理申请记录信息
	getAdminStatus(params){
		return request({
			url:"/agent/user/getInfo",
			method:'get'
		})
	},
	//编辑信息
	editAdminInfo(params){
		let post_param = qs.stringify(params,{indices: false })
		return request({
			url:"/act/update?" +post_param,
			method:'put'
		})
	},
	//获取当前代理的基本信息
	getAdminInfo(){
		return request({
			url:"/act/getInfo",
			method:"get"
		})
	},
	//获取当前代理的收益信息
	getAdminAssets(){
		return request({
			url:"/user/assets/info",
			method:"get"
		})
	},
	//修改当前代理密码
	editAdminPwd(params){
		let post_param = qs.stringify(params,{indices: false })
		return request({
			url:'/act/cpwd?' + post_param,
			method:'put'
		})
	},
	//获取单一用户数据
	getAdminOneDataSheet(params){
		let post_param = ""
		if(params != ""){
			post_param = qs.stringify(params,{indices: false })
			post_param = "?" + post_param
		}
		return request({
			url:'/user/statistic/personal/order' + post_param,
			method:'get'
		})
	},
	//获取用户统计表数据列表
	getAdminDataSheetList(){
		return request({
			url:'/user/statistic/member/order',
			method:'get'
		})
	},
	
}
export default adminAct;